home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / src / fig10_02.jar / Ch10 / Fig10_02 / Point1.cpp < prev    next >
C/C++ Source or Header  |  1997-10-28  |  293b  |  15 lines

  1. // Fig. 10.2: point1.cpp
  2. // Member function definitions for class Point
  3. #include "point1.h"
  4.  
  5. Point::Point( int a, int b ) { setPoint( a, b ); }
  6.  
  7. void Point::setPoint( int a, int b )
  8. {
  9.    x = a;
  10.    y = b;
  11. }
  12.  
  13. void Point::print() const 
  14.    { cout << '[' << x << ", " << y << ']'; }
  15.